package com.fieldchain.ex.fa100.mvp.presenter;

import com.fieldchain.ex.fa100.bean.C2CBean;
import com.fieldchain.ex.fa100.bean.C2CBuyBean;
import com.fieldchain.ex.fa100.inter.BoolMsgCallBack;
import com.fieldchain.ex.fa100.mvp.base.MyBasePresenter;
import com.fieldchain.ex.fa100.mvp.callback.C2CBuyCallBack;
import com.fieldchain.ex.fa100.mvp.callback.C2CSimpleCallBack;
import com.fieldchain.ex.fa100.mvp.model.C2CBuyModle;
import com.fieldchain.ex.fa100.mvp.view.C2CBuyView;

/**
 * Created by biyunlong
 * Email: 1225198434@qq.com
 * Data:  2018/9/18
 */
public class C2CBuyPresenter extends MyBasePresenter<C2CBuyModle,C2CBuyView> {

    public void unShowDialog(){
        model.unShowDialog();
    }
    public void updateUser(){
        model.updateUser(mContext,new BoolMsgCallBack() {
            @Override
            public void receive(boolean status, String msg) {
                if(view!=null){
                    view.setTvSure(status,msg);
                }

            }
        });
    }
    public void getData(){
        model.getData(new C2CSimpleCallBack() {
            @Override
            public void receiveData(C2CBean bean, int code) {
                if(view!=null) {
                    view.receiveData(bean, code);
                }
            }
        });
    }
    public void recharge(String amount, String password){
        model.recharge(amount, password, new C2CBuyCallBack() {
            @Override
            public void requestCallBack(C2CBuyBean c2CBuyBean, int code) {
                view.requestCallBack(c2CBuyBean,code);
            }
        });
    }
}
